<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>智慧养老管理系统</title>
    <link rel="stylesheet" href="./css/component.css">
    <link rel="stylesheet" href="./css/admin.css">
    <link href="css/index.css" rel="stylesheet" />
    <link rel="stylesheet" href="./css/font-awesome.min.css">
    <script src="js/JQuery2.1.4.js"></script>
    <script src="js/vue.js"></script>
    <script src="js/axios.js"></script>
    <script src="js/qs.js"></script>
    <script src="./js/common.js"></script>


</head>

<body>
    <div class="admin clearfix">
        <div class="top PublicHead clearfix">
            <div class="left">
                智慧养老管理系统
            </div>
            <div class="right RightBox clearfix" id="app">
                <div class="UserPhotoBox" v-if="onlogin">
                    <div class="UserPic">
                        <img :src="user.img" />
                    </div>
                    <div class="UserName">
                        {{user.username}}
                    </div>
                </div>
                <div class="UserPhotoBox" v-else>
                    <div class="UserPic">
                        <img src="images/user.jpg" />
                    </div>
                    <div class="UserName">
                        <a herf="login.html">请登录</a>
                    </div>
                </div>
                <a href="login.html">
                    <i class="fa fa-fw fa-power-off"></i>
                    <span>退出后台</span>
                </a>
            </div>
        </div>
        <div class="body">
            <div class="left">
                <div class="menu">
                    <div class="title">
                        <a href="welcome.html" target="rightiframe" style="display: inline-block;width: 158px;height: 39px;position: relative;top: 10px;color: white;text-decoration: none">
                            <i class="fa fa-fw fa-home"> </i> 站点仪表
                        </a>
                    </div>
                </div>
                <!-- 分割线 -->
                <div class="menu">
                    <div class="title">
                            <i class="fa fa-fw fa-file-powerpoint-o"></i> 康护管理模块 <i class="fa fa-fw fa-angle-right"></i>
                    </div>

                    <ul class="downmenu">
                        <li><a href="jk.html" target="rightiframe">健康管理</a></li>
                        <li><a href="hl.html" target="rightiframe">护理管理</a></li>
                        <li><a href="ky.html" target="rightiframe">康娱管理</a></li>
                    </ul>
                </div>
                <!-- 分割线 -->                
                <div class="menu">
                    <div class="title">
                            <i class="fa fa-fw fa-image"></i> 服务管理模块 <i class="fa fa-fw fa-angle-right"></i>
                    </div>

                    <ul class="downmenu">
                        <li><a href="cd.html" target="rightiframe">餐饮管理</a></li>
                        <li><a href="jd.html" target="rightiframe">接待管理</a></li>
                    </ul>
                </div>
                <!-- 分割线 -->                
                <div class="menu">
                    <div class="title">
                            <i class="fa fa-fw fa-image"></i> 人事管理模块 <i class="fa fa-fw fa-angle-right"></i>
                    </div>

                    <ul class="downmenu">
                        <li><a href="hq.html" target="rightiframe">后勤管理</a></li>
                        <li><a href="lr.html" target="rightiframe">老人管理</a></li>
                    </ul>
                </div>
                <!-- 分割线 -->
                <div class="menu">
                    <div class="title">
                        <i class="fa fa-fw fa-cog"></i> 机构管理模块 <i class="fa fa-fw fa-angle-right"></i>
                    </div>
                        <ul class="downmenu">
                            <li><a href="organ.html" target="rightiframe">系统管理</a></li>
                            <li><a href="zl.html" target="rightiframe">资料管理</a></li>
                        </ul>
                </div>
            </div>
            <!-- 分割线 -->
            <div class="right">
                <iframe src="welcome.html" frameborder="0" id="rightiframe" name="rightiframe"></iframe>
            </div>
        </div>
    </div>
</body>
<script>
    /**
     * 检查登录
     */
    var login = new Vue({
        el: "#app",/*元素挂载点*/
        data: {
            onlogin: false,
            nickName:"",
            img:"",
            user:{}
        },
        mounted: function() {
            axios.get("/user/checkLogin").then(rt => {
                if (rt.status == 200) { // 说明请求成功
                    if (rt.data.code == 200) { // 说明登录
                        this.user = rt.data.data;
                        this.onlogin = true;
                    } else {
                        this.onlogin = false;
                        location.href = "login.html";
                    }
                } else {
                    this.onlogin = false;
                    location.href = "login.html";
                }
            })
        }
    })

</script>
</html>